<%- include ("../public/page_header.html") %>

  <script type="text/javascript" src="/admin/bootstrap/js/bootstrap.js"></script>

  <link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet"
    type="text/css" />
  <script type="text/javascript"
    src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

  <script type="text/javascript" src="/wysiwyg-editor/js/languages/zh_cn.js"></script>


  <div class="panel panel-default">
    <div class="panel-heading">
      修改内容
    </div>
    <div class="panel-body">
      <div class="table-responsive input-form articel_content">
        <form action="/<%=adminPath%>/article/doEdit" method="post" enctype="multipart/form-data">
          <input type="hidden" name="id" value="<%=list._id%>" />
          <ul id="myTab" class="nav nav-tabs">

            <li class="active">
              <a href="#index" data-toggle="tab">基本设置</a>
            </li>
            <li>
              <a href="#info" data-toggle="tab">
                内容详情
              </a>
            </li>
            <li>
              <a href="#seo" data-toggle="tab">
                Seo设置
              </a>
            </li>
          </ul>
          <div id="myTabContent" class="tab-content">

            <div class="tab-pane fade  in active" id="index">
              <ul>

                <li>
                  <span>所属分类: </span>
                  <select name="cid" id="cid">

                    <%for(var i=0;i<articleCate.length;i++){%>
                      <option value="<%=articleCate[i]._id%>"
                        <%if(list.cid.toString()==articleCate[i]._id.toString()){%>selected<%}%> >
                          <%=articleCate[i].title%>
                      </option>


                      <%for(var j=0;j<articleCate[i].items.length;j++){%>
                        <option value="<%=articleCate[i].items[j]._id%>"
                          <%if(list.cid.toString()==articleCate[i].items[j]._id.toString()){%>selected<%}%> >　--
                            <%=articleCate[i].items[j].title%>
                        </option>
                        <%}%>
                          <%}%>

                  </select>
                </li>
                <li> <span>内容标题: </span> <input type="text" name="title" value="<%=list.title%>" class="title" /></li>

                <li> <span>跳转地址: </span> <input type="text" name="link" value="<%=list.link%>" />
                  <i>说明：不为空点击文章将跳转到此地址</i></li>

                <li> <span>封面图:</span>
                  <input type="file" name="article_img" />

                  <%if(list.article_img){%>
                    <br><br>
                    <span></span>
                    <img src="/<%=list.article_img%>" width="80" />
                    <%}%>

                </li>
                <li> <span>作　　者: </span> <input type="text" name="author" value="<%=list.author%>" /></li>
                <li> <span>排　　序: </span> <input type="text" name="sort" value="<%=list.sort%>" /></li>

                <li> <span>状　　态:</span>
                  <input type="radio" name="status" <% if (list.status==1){%> checked <%}%> value="1" id="a" /> <label
                      for="a">显示</label>
                    <input type="radio" name="status" <% if (list.status==0){%> checked <%}%> value="0" id="b" /><label
                        for="b">隐藏</label>
                </li>

                <li> <span>加入推荐:</span>　
                  <input type="checkbox" value="1" name="is_best" <% if (list.is_best==1){%> checked <%}%> /> 精品
                    <input type="checkbox" value="1" name="is_hot" <% if (list.is_hot==1){%> checked <%}%>/> 热门
                </li>


              </ul>
            </div>
            <div class="tab-pane fade" id="info">
              <textarea name="content" id="content" cols="30" rows="10"><%=list.content%></textarea>
            </div>
            <div class="tab-pane fade" id="seo">
              <ul>
                <li> <span>关键词: </span> <input type="text" name="keywords" value="<%=list.keywords%>" class="title" />
                </li>
                <li> <span>Seo描述:</span>
                  <textarea name="description" id="description" cols="84" rows="4"><%=list.description%></textarea>
                </li>
              </ul>
            </div>

            <br />
            <br />
            <button type="submit" class="btn btn-primary">提交</button>
          </div>

        </form>
      </div>
    </div>


  </div>

  <script>
    new FroalaEditor('#content', {
      height: 260,
      language: 'zh_cn',
      imageUploadURL: '/<%=adminPath%>/article/doUploadImage',
    });
  </script>
  </body>

  </html>
